package com.atguigu;

import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

public class Customer {

	private int age = 0;
	
	public static void main(String[] args) {
		Ticket ticket = new Ticket();
		
		Thread  t1 = new Thread(ticket, "窗口1");
		Thread  t2 = new Thread(ticket, "窗口2");
		Thread  t3 = new Thread(ticket, "窗口3");
		System.out.println("1111111111111");
		System.out.println("2222222222222");
        System.out.println("33333333333333");			      
		Ticket2 ticket2 = new Ticket2();
		
		Runnable r = new FutureTask<Integer>(ticket2);
		
		Thread t4 =new Thread(r,"..");
		
		t1.start();
		t2.start();
		t3.start();
		
		
	}
	
	
	
	
	
}

class Ticket2 implements Callable<Integer>{

	@Override
	public Integer call() throws Exception {
		
		return null;
	}
	
	
	
}





class Ticket implements Runnable{
	
	int ticket = 30;

	@Override
	public synchronized void run() {
		while(ticket >0){
			System.out.println(Thread.currentThread().getName() + "卖出一张，剩余"+ --ticket + "票");
		}
	}
	
	
	
	
	
	
}